<template>
	<div>
	
		<div v-if="!isLogin">
			<router-link to="/login">去登陆</router-link>
		</div>
		
		<div v-else class="center" @click="$router.push('/userinfo')">
			<p> 您的昵称 {{userInfo.nickname}}</p>
			<img width="50" height="50" :src="userInfo.avatar" alt="">
			

		</div>


		<van-cell is-link  to="/edit">
			修改密码
		</van-cell>
		<van-cell is-link  to="/MyPublish">
			我的发布
		</van-cell>
<van-button v-if="isLogin"  @click="logout">退出登陆</van-button>
	</div>
</template>

<script>
	import {
		mapState,
		mapMutations
	} from 'vuex';
	
	
	export default {
		name: "myView",
		data() {
			return {

			}
		},
		computed: {

			...mapState('user', ['isLogin', 'userInfo'])
		},
		methods: {
		
			logout() {
				localStorage.clear();

				this.$store.commit('user/quit')

			}
		}


	}
</script>

<style>
</style>
